package com.example.myspringpro.controller;

import com.example.myspringpro.exception.MyException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Description
 * @Author allenhu <huxiangneng@163.com>
 * @Date 2019/04/28
 * @Version V1.0.0
 **/
@Controller
public class IndexController {

    @RequestMapping(value="/index")
    public String indexAction(){
        return "index";
    }

    @RequestMapping(value="/ex")
    public String testException(){
        throw new MyException("测试异常", "001");
    }


}
